﻿@using myTutor.Models

@{
    ViewBag.Title = "Trang chủ";
    ViewBag.ShowMain = true;
    ViewBag.ShowSubMain = true;
    ViewBag.ShowSubFooter = true;
    ViewBag.AdsZoneKey = "HomePage";
}

@using (Html.BeginForm("Search", "Home"))
{
    <input type="hidden" name="searchType" value="4"/>
    <h2 style="float:left; border-bottom:1px dashed;">CÁC LỚP CẦN GIA SƯ MỚI NHẤT</h2><br />
    <strong><span style="margin-top:19px; margin-left:10px; margin-bottom:10px; float:right;" class="submit-img but-blue" ><span class="icon icon-search"></span><input type="submit" class="but-submit submit-blue" value="XEM DANH SÁCH TẤT CẢ LỚP" /></span></strong>
}
<div class="function-content-layout function-overview-table">
    <div class="function-content-layout function-overview-table">
        @{var classes = Class.GetTopClasses(Config.GetNumOfTopClasses());
          bool isOddRow = true;
          bool isOddCol = true;
          if (classes.Count > 0)
          {
              for (int i = 0; i < classes.Count; i++)
              {
                <div class="function-layout-cell">
                    <div style="width:150px;height:335px;" class="function-overview-table-inner @if (isOddRow && isOddCol || !isOddRow && !isOddCol)
                                                                                                {<text>function-overview-table-inner-dark</text>}
                                                                                                else
                                                                                                {<text>function-overview-table-inner-light</text>}" align="center">
                        <p style="text-align:left;">
                            <a href="~/Class/Detail/@classes[i].Id"><label title="Xem chi tiết lớp" style="cursor:pointer; overflow:hidden; display:block; white-space:nowrap;" title='@classes[i].ClassRequirement.Id'>Mã lớp: @Class.GetMakeUpId(classes[i].Id)</label></a>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@classes[i].ClassRequirement.Subjects'>Môn: @classes[i].ClassRequirement.Subjects</label>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@classes[i].ProvinceMaster.Name'>Địa điểm: @classes[i].ProvinceMaster.Name</label>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@classes[i].GetShortRequiredTutorType'>Yêu cầu: @classes[i].GetShortRequiredTutorType</label>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@string.Format("{0:#,##0 VNĐ}", @classes[i].ClassRequirement.SalaryAmount)'>Lương: @string.Format("{0:#,##0 VNĐ}", @classes[i].ClassRequirement.SalaryAmount)</label>
                        </p>  
                        <p style="text-align:left;">
                            <img src="~/Files/Classes/@classes[i].ClassRequirement.ClassMaster.ImageFileName" alt="" style="width:135px; height:180px; padding-left:8px;" />
                        </p>   
                        <p style="padding-left:1px;"><strong><a class="button-img but-orange" href="~/Tutor/GetClass?classId=@classes[i].Id"><span class="icon icon-submit"></span><span>Dạy Lớp Này</span></a></strong></p>
                    </div>
                </div>
                                                                                                if ((i + 1) % Config.GetNumOfTopClassesInRow() == 0)
                                                                                                {
                    <div class="function-content-layout-row"></div>
                                                                                                    isOddRow = !isOddRow;
                                                                                                    isOddCol = true;
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                    isOddCol = !isOddCol;
                                                                                                }
              }
          }
          else
          {
              <text>Thông tin đang được cập nhật...</text>
          }
        }
    </div>
</div>
@using (Html.BeginForm("Search", "Home"))
{
    <input type="hidden" name="searchType" value="0"/>
    <h2 style="float:left; border-bottom:1px dashed;">CÁC GIA SƯ TÌM LỚP MỚI NHẤT</h2><br />
    <strong><span style="margin-top:19px; margin-left:10px;margin-bottom:10px; float:right;" class="submit-img but-blue" ><span class="icon icon-search"></span><input type="submit" class="but-submit submit-blue" value="XEM DANH SÁCH TẤT CẢ GIA SƯ" /></span></strong>
}
<div class="function-content-layout function-overview-table">
    <div class="function-content-layout function-overview-table">
        @{var tutors = TutorClassFindingRequest.GetTopTutors(Config.GetNumOfTopTutors());
          if (tutors.Count > 0)
          {
              isOddRow = true;
              isOddCol = true;
              for (int i = 0; i < tutors.Count; i++)
              {
                <div class="function-layout-cell">
                    <div style="width:150px;height:335px;" class="function-overview-table-inner @if (isOddRow && isOddCol || !isOddRow && !isOddCol)
                                                                                                {<text>function-overview-table-inner-dark</text>}
                                                                                                else
                                                                                                {<text>function-overview-table-inner-light</text>}" align="center">
                        <label class="function-wrap-title" style="padding-top:14px; text-align:left;">@tutors[i].GetClassesCanTeach</label>
                        <p style="text-align:left;">
                            <a href="~/Tutor/Detail/@tutors[i].Id"><label title="Xem chi tiết gia sư" style="cursor:pointer; overflow:hidden; display:block; white-space:nowrap;" title='@tutors[i].TutorClassRequireSkill.Subjects'>Mã gia sư: @TutorClassFindingRequest.GetMakeUpId(tutors[i].Id)</label></a>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@tutors[i].TutorClassRequireSkill.Subjects'>Môn: @tutors[i].TutorClassRequireSkill.Subjects</label>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@tutors[i].ProvinceMaster.Name'>Địa điểm: @tutors[i].ProvinceMaster.Name</label>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@tutors[i].GetShortTutorType'>Thành phần: @tutors[i].GetShortTutorType</label>
                            <label style="overflow:hidden; display:block; white-space:nowrap;" title='@string.Format("{0:#,##0 VNĐ}", @tutors[i].TutorClassRequireSkill.SalaryAmount)'>Lương: @string.Format("{0:#,##0 VNĐ}", @tutors[i].TutorClassRequireSkill.SalaryAmount)</label> 
                        </p>
                        <p style="text-align:left;">
                        @{string tutorImagePath = string.IsNullOrEmpty(tutors[i].ImageFileName) ? (tutors[i].Gender == "1" ? Config.GetDefaultTutorImageMale() : Config.GetDefaultTutorImageFemale()) : tutors[i].ImageFileName;}
                            <img src="~/Files/Tutors/@tutorImagePath" alt="" style="width:114px; height:152px; padding-left:15px;" />
                        </p>
                        <p style="padding-left:1px;"><strong><a class="button-img but-orange" href="~/Class/HireTutor?tutorId=@tutors[i].Id"><span class="icon icon-submit"></span><span>Học Lớp Này</span></a></strong></p>
                    </div>
                </div>
                          if ((i + 1) % Config.GetNumOfTopTutorsInRow() == 0)
                          {
                    <div class="function-content-layout-row"></div>
                              isOddRow = !isOddRow;
                              isOddCol = true;
                          }
                          else
                          {
                              isOddCol = !isOddCol;
                          }
              }
          }
          else
          {
                <text>Thông tin đang được cập nhật...</text>
             }
            }
    </div>
</div>